<template>
	<view class="bgc_f6f6f6">
		<!-- 
			"1": "轮播抽奖",
			"2": "现金抽奖",
			"3": "今日奖品",
			"4": "积分抽奖",
			"5": "即将上线",
			"6": "积分大转盘",
			"7": "运气广场"
		 -->
		<view v-for="(item, index) in moduleList" :key="index">
			<!-- 轮播抽奖 -->
			<slideshow v-if="item.type == '1'" :item="item" />
			<!-- <luckyRemind v-else-if="item.type == '1'" /> -->
			<!-- 现金抽奖 -->
			<xianjinLucky v-else-if="item.type == '2'" :item="item" />
			<!-- 今日奖品 -->
			<todayPrize v-else-if="item.type == '3'" :item="item" />
			<!-- 积分抽奖 -->
			<luckyCard v-else-if="item.type == '4'" :item="item" />
			<!-- <productDisplay v-else-if="item.type == '1'" />
			<newProductRecom v-else-if="item.type == '1'" /> -->
			<!-- 即将上线 -->
			<comingOnlineSoon v-else-if="item.type == '5'" :item="item" />
			<!-- 积分大转盘 -->
			<luckyImg v-else-if="item.type == '6'" :item="item" />
			<!-- 运气广场 -->
			<luckyPlaza v-else-if="item.type == '7'" :item="item" />
			<err :title="item.type_name" v-else></err>
		</view>
	</view>
</template>

<script>
	import slideshow from './components/slideshow'; // 轮播
	import luckyRemind from './components/luckyRemind'; // 明天开奖
	import todayPrize from './components/todayPrize'; // 今日奖品
	import productDisplay from './components/productDisplay'; //
	import luckyCard from './components/luckyCard'; // 积分抽奖
	import newProductRecom from './components/newProductRecom'; // 新品抽奖
	import comingOnlineSoon from './components/comingOnlineSoon'; // 即将上线
	import luckyImg from './components/luckyImg'; // 积分转盘
	import luckyPlaza from './components/luckyPlaza'; // 运气广场
	import xianjinLucky from './components/xianjinLucky'; // 现金抽奖
	import err from './components/err.vue';
	export default {
		components: {
			slideshow,
			xianjinLucky,
			luckyRemind,
			todayPrize,
			productDisplay,
			luckyCard,
			luckyImg,
			newProductRecom,
			comingOnlineSoon,
			luckyPlaza,
			err
		},
		data() {
			return {
				moduleList: [],
			}
		},
		onShow() {
			wx.showShareMenu({
				withShareTicket: true,
				//设置下方的Menus菜单，才能够让发送给朋友与分享到朋友圈两个按钮可以点击
				menus: ["shareAppMessage", "shareTimeline"]
			})
		},
		methods: {

			shareAppMessage() {},
			shareTimeline() {},
			jumpPage() {
				uni.navigateTo({
					url: '/packages/integralTurntable/index'
				})
			},
			init() {
				uni.$http.post('/public/index').then(res => {
					const {
						data
					} = res.data || {};
					this.moduleList = data.list;
					console.log('this.moduleList:', this.moduleList)
				});
			}
		},
		onLoad() {
			this.init();
		}
	}
</script>